{
  "info": {
    "_postman_id": "7ce07e46-010a-4b1b-9264-590cb23fa921",
    "name": "ERA API 192.168.1.10",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "654357"
  },
  "item": [
    {
      "name": "GET List",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/smart/Accounts",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "smart",
            "Accounts"
          ],
          "query": [
            {
              "key": "limit",
              "value": "5",
              "disabled": true
            },
            {
              "key": "offset",
              "value": "2",
              "disabled": true
            },
            {
              "key": "order",
              "value": "[{\"name\":\"asc\"}]",
              "disabled": true
            },
            {
              "key": "filter",
              "value": "[\"contains\",[\"property\",\"name\"],[\"const\",\"Альфа\"]]",
              "disabled": true
            },
            {
              "key": "filter",
              "value": "[\"like\",[\"property\",\"name\"],[\"const\",\"*Альфа*\"]]",
              "disabled": true
            },
            {
              "key": "countonly",
              "value": "true",
              "disabled": true
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "GET Item",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/smart/Accounts/66021fd2-b7b3-4e48-916a-cc7f3c3d2bf7",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "smart",
            "Accounts",
            "66021fd2-b7b3-4e48-916a-cc7f3c3d2bf7"
          ]
        }
      },
      "response": []
    },
    {
      "name": "POST item",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"author_id\": \"0ce07813-018f-7be9-2969-960002bdc633\",\r\n    \"ext\": {\r\n        \"industry\": \"Страхование\"\r\n    },\r\n    \"name\": \"Альфа Групп Четвертая\"\r\n}\r\n",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/smart/Accounts",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "smart",
            "Accounts"
          ]
        }
      },
      "response": []
    },
    {
      "name": "PUT item",
      "request": {
        "method": "PUT",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"author_id\": \"0ce07813-018f-7be9-2969-960002bdc633\",\r\n    \"name\": \"Альфа Групп Вторая\"\r\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/smart/Accounts/66021fd2-b7b3-4e48-916a-cc7f3c3d2bf7",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "smart",
            "Accounts",
            "66021fd2-b7b3-4e48-916a-cc7f3c3d2bf7"
          ]
        },
        "description": "Изменяет ресурс с указанным идентификатором в коллекции полной заменой.\n\nИдентификатор заменить невозможно.  \nВ качестве тела запроса целиком передается новый ресурс. Если ранее ресурс отсутствовал, то он создается с указанным идентификатором.\n\nНеуказанные поля остаются пустыми"
      },
      "response": []
    },
    {
      "name": "PATCH item",
      "request": {
        "method": "PATCH",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"ext\": {\r\n        \"address\": {\r\n            \"city\": \"Саратов\"\r\n        }\r\n    }\r\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/smart/Accounts/66021fd2-b7b3-4e48-916a-cc7f3c3d2bf7",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "smart",
            "Accounts",
            "66021fd2-b7b3-4e48-916a-cc7f3c3d2bf7"
          ]
        }
      },
      "response": []
    },
    {
      "name": "CLEAR List",
      "request": {
        "method": "CLEAR",
        "header": [],
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/smart/Accounts",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "smart",
            "Accounts"
          ]
        }
      },
      "response": []
    },
    {
      "name": "DELETE Item",
      "request": {
        "method": "DELETE",
        "header": [],
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/smart/Accounts/ccdb400b-b030-464c-a27e-5ed7ebb33471",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "smart",
            "Accounts",
            "ccdb400b-b030-464c-a27e-5ed7ebb33471"
          ]
        }
      },
      "response": []
    },
    {
      "name": "GET Archive dialogs",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "var template = `",
              "<style type=\"text/css\">",
              "    .tftable {font-size:14px;color:#333333;width:100%;border-width: 1px;border-color: #87ceeb;border-collapse: collapse;}",
              "    .tftable th {font-size:18px;background-color:#87ceeb;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;text-align:left;}",
              "    .tftable tr {background-color:#ffffff;}",
              "    .tftable td {font-size:14px;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;}",
              "    .tftable tr:hover {background-color:#e0ffff;}",
              "</style>",
              "",
              "<table class=\"tftable\" border=\"1\">",
              "    <tr>",
              "        <th>Dialed Number</th>",
              "        <th>Direction</th>",
              "        <th>Display</th>",
              "        <th>Duration</th>",
              "        <th>Duration ACD</th>",
              "        <th>Duration Hold</th>",
              "        <th>Duration IVR</th>",
              "        <th>Duration Talk</th>",
              "        <th>Duration Wait</th>",
              "        <th>ID</th>",
              "        <th>Result</th>",
              "        <th>Search Context</th>",
              "        <th>Sides A Display</th>",
              "        <th>Sides B Display</th>",
              "        <th>Time Start</th>",
              "    </tr>",
              "    ",
              "    {{#each response}}",
              "        <tr>",
              "            <td>{{dialedNumber}}</td>",
              "            <td>{{direction}}</td>",
              "            <td>{{display}}</td>",
              "            <td>{{duration}}</td>",
              "            <td>{{durationACD}}</td>",
              "            <td>{{durationHold}}</td>",
              "            <td>{{durationIVR}}</td>",
              "            <td>{{durationTalk}}</td>",
              "            <td>{{durationWait}}</td>",
              "            <td>{{id}}</td>",
              "            <td>{{result}}</td>",
              "            <td>{{searchContext}}</td>",
              "            <td>{{sidesA.[0].display}}</td>",
              "            <td>{{sidesB.[0].display}}</td>",
              "            <td>{{timeStart}}</td>",
              "        </tr>",
              "    {{/each}}",
              "</table>",
              "`;",
              "",
              "function constructVisualizerPayload() {",
              "    return {response: pm.response.json()}",
              "}",
              "",
              "pm.visualizer.set(template, constructVisualizerPayload());",
              "",
              "pm.test(\"Response status code is 200\", function () {",
              "  pm.response.to.have.status(200);",
              "});",
              "",
              "",
              "pm.test(\"Response time is less than 200ms\", function () {",
              "  pm.expect(pm.response.responseTime).to.be.below(200);",
              "});",
              "",
              "",
              "pm.test(\"Validate the schema for the response fields\", function () {",
              "    const responseData = pm.response.json();",
              "    ",
              "    pm.expect(responseData).to.be.an('array');",
              "    responseData.forEach(function(item) {",
              "        pm.expect(item.dialedNumber).to.exist.and.to.be.a('string');",
              "        pm.expect(item.direction).to.exist.and.to.be.a('string');",
              "        pm.expect(item.display).to.exist.and.to.be.a('string');",
              "        pm.expect(item.duration).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationACD).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationHold).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationIVR).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationTalk).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationWait).to.exist.and.to.be.a('number');",
              "        pm.expect(item.id).to.exist.and.to.be.a('string');",
              "        pm.expect(item.result).to.exist.and.to.be.a('string');",
              "        pm.expect(item.searchContext).to.exist.and.to.be.a('string');",
              "        pm.expect(item.sidesA).to.exist.and.to.be.an('array');",
              "        pm.expect(item.sidesB).to.exist.and.to.be.an('array');",
              "        pm.expect(item.timeStart).to.exist.and.to.be.a('string');",
              "    });",
              "});",
              "",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/telephony/ArchiveDialogs?interval=[\"2026-05-01T00:00:00.000Z\", \"2026-05-29T22:00:00.000Z\"]",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "telephony",
            "ArchiveDialogs"
          ],
          "query": [
            {
              "key": "interval",
              "value": "[\"2026-05-01T00:00:00.000Z\", \"2026-05-29T22:00:00.000Z\"]"
            },
            {
              "key": "order",
              "value": "[{\"timeStart\":\"desc\"}]",
              "disabled": true
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "GET ArchiveConnections",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "var template = `",
              "<style type=\"text/css\">",
              "    .tftable {font-size:14px;color:#333333;width:100%;border-width: 1px;border-color: #87ceeb;border-collapse: collapse;}",
              "    .tftable th {font-size:18px;background-color:#87ceeb;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;text-align:left;}",
              "    .tftable tr {background-color:#ffffff;}",
              "    .tftable td {font-size:14px;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;}",
              "    .tftable tr:hover {background-color:#e0ffff;}",
              "</style>",
              "",
              "<table class=\"tftable\" border=\"1\">",
              "    <tr>",
              "        <th>Dialed Number</th>",
              "        <th>Direction</th>",
              "        <th>Display</th>",
              "        <th>Duration</th>",
              "        <th>Duration ACD</th>",
              "        <th>Duration Hold</th>",
              "        <th>Duration IVR</th>",
              "        <th>Duration Talk</th>",
              "        <th>Duration Wait</th>",
              "        <th>ID</th>",
              "        <th>Result</th>",
              "        <th>Search Context</th>",
              "        <th>Sides A Display</th>",
              "        <th>Sides B Display</th>",
              "        <th>Time Start</th>",
              "    </tr>",
              "    ",
              "    {{#each response}}",
              "        <tr>",
              "            <td>{{dialedNumber}}</td>",
              "            <td>{{direction}}</td>",
              "            <td>{{display}}</td>",
              "            <td>{{duration}}</td>",
              "            <td>{{durationACD}}</td>",
              "            <td>{{durationHold}}</td>",
              "            <td>{{durationIVR}}</td>",
              "            <td>{{durationTalk}}</td>",
              "            <td>{{durationWait}}</td>",
              "            <td>{{id}}</td>",
              "            <td>{{result}}</td>",
              "            <td>{{searchContext}}</td>",
              "            <td>{{sidesA.[0].display}}</td>",
              "            <td>{{sidesB.[0].display}}</td>",
              "            <td>{{timeStart}}</td>",
              "        </tr>",
              "    {{/each}}",
              "</table>",
              "`;",
              "",
              "function constructVisualizerPayload() {",
              "    return {response: pm.response.json()}",
              "}",
              "",
              "pm.visualizer.set(template, constructVisualizerPayload());",
              "",
              "pm.test(\"Response status code is 200\", function () {",
              "  pm.response.to.have.status(200);",
              "});",
              "",
              "",
              "pm.test(\"Response time is less than 200ms\", function () {",
              "  pm.expect(pm.response.responseTime).to.be.below(200);",
              "});",
              "",
              "",
              "pm.test(\"Validate the schema for the response fields\", function () {",
              "    const responseData = pm.response.json();",
              "    ",
              "    pm.expect(responseData).to.be.an('array');",
              "    responseData.forEach(function(item) {",
              "        pm.expect(item.dialedNumber).to.exist.and.to.be.a('string');",
              "        pm.expect(item.direction).to.exist.and.to.be.a('string');",
              "        pm.expect(item.display).to.exist.and.to.be.a('string');",
              "        pm.expect(item.duration).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationACD).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationHold).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationIVR).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationTalk).to.exist.and.to.be.a('number');",
              "        pm.expect(item.durationWait).to.exist.and.to.be.a('number');",
              "        pm.expect(item.id).to.exist.and.to.be.a('string');",
              "        pm.expect(item.result).to.exist.and.to.be.a('string');",
              "        pm.expect(item.searchContext).to.exist.and.to.be.a('string');",
              "        pm.expect(item.sidesA).to.exist.and.to.be.an('array');",
              "        pm.expect(item.sidesB).to.exist.and.to.be.an('array');",
              "        pm.expect(item.timeStart).to.exist.and.to.be.a('string');",
              "    });",
              "});",
              "",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/callcenter/connections/ArchiveConnections?interval=[\"2026-05-01T00:00:00.000Z\", \"2026-05-29T22:00:00.000Z\"]",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "callcenter",
            "connections",
            "ArchiveConnections"
          ],
          "query": [
            {
              "key": "interval",
              "value": "[\"2026-05-01T00:00:00.000Z\", \"2026-05-29T22:00:00.000Z\"]"
            },
            {
              "key": "order",
              "value": "[{\"timeStart\":\"desc\"}]",
              "disabled": true
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "AI POST",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"method\": \"GPTDialogs_create\",\n    \"request\": {\n        \"bot_code\": \"qwen1\",\n        \"message\": \"Куда идем мы с пятачком?\"\n    }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{ERA}}/rest/v1/domain/nservices/ai.HolderService",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "domain",
            "nservices",
            "ai.HolderService"
          ]
        }
      },
      "response": []
    },
    {
      "name": "AI POST Dialog",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"method\": \"GPTDialog_sendMessage\",\n    \"request\": {\n          \"dialog_link\": {\n            \"id\": \"070166c5-7480-48c1-9d89-bbe764bcd666\",\n            \"timestamp\": 1779355818915\n        },\n        \"message\": \"Переведи на английский?\"\n    }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{ERA}}/rest/v1/domain/nservices/ai.HolderService",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "domain",
            "nservices",
            "ai.HolderService"
          ]
        }
      },
      "response": []
    },
    {
      "name": "MakeCall",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"method\": \"CurrentCalls_make\",\r\n    \"request\": {\r\n        \"user_id\": \"0ce07813-018f-7be9-2969-960002bdc633\",\r\n        \"parameters\": {\r\n            \"number\": \"1007\"\r\n        }\r\n    }\r\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{ERA}}/rest/v1/domain/nservices/callcenter.HolderService",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "domain",
            "nservices",
            "callcenter.HolderService"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Получить статусы",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "https://{{ERA}}/rest/v1/model/callcenter/users/CurrentUserStates?groupby={\"Состояние\":[\"property\",\"status\"]}&aggr={\"Кол-во\":[\"count\",[\"const\",1]]}",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "model",
            "callcenter",
            "users",
            "CurrentUserStates"
          ],
          "query": [
            {
              "key": "groupby",
              "value": "{\"Состояние\":[\"property\",\"status\"]}"
            },
            {
              "key": "aggr",
              "value": "{\"Кол-во\":[\"count\",[\"const\",1]]}"
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "Изменить статус",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"method\":\"CurrentUserState_setNotReady\",\r\n    \"request\": {\r\n        \"id\": \"0ce07813-018f-7be9-2969-960002bdc633\",\r\n        \"user_id\": \"0ce07813-018f-7be9-2969-960002bdc633\",\r\n        \"parameters\": {}\r\n    },\r\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{ERA}}/rest/v1/domain/nservices/callcenter.HolderService",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "domain",
            "nservices",
            "callcenter.HolderService"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Отправка внутреннего сообщения",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\r\n         \"method\":\"InnerDialog_sendText\",\r\n         \"request\":{\r\n            \"id\":\"428a8cd0-94a9-48be-806e-ac2c7240f76a\",\r\n            \"user_id\":\"0ce07813-018f-7be9-2969-960002bdc633\",\r\n            \"parameters\":{\r\n               \"text\":\"SL Первой линии за сегодня ниже 80\"\r\n            }\r\n         }\r\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{ERA}}/rest/v1/domain/nservices/im.HolderService",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "domain",
            "nservices",
            "im.HolderService"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Отправка уведомления",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"method\": \"Notifications_create\",\r\n    \"request\": {\r\n        \"user_id\": \"0ce07813-018f-7be9-2969-960002bdc633\",\r\n        \"alertMode\": \"notify_success\",\r\n        \"message\": \"Привет из сценария\",\r\n        \"clientCode\": \"EraClientUtils.showBrowserNotification('Привет из сценария')\"\r\n    }\r\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://{{ERA}}/rest/v1/domain/nservices/platform.HolderService",
          "protocol": "https",
          "host": [
            "{{ERA}}"
          ],
          "path": [
            "rest",
            "v1",
            "domain",
            "nservices",
            "platform.HolderService"
          ]
        }
      },
      "response": []
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "9f3c2a7e8b41d6c0aa5f93e14b7d28c6",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          ""
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          ""
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "ERA",
      "value": ""
    }
  ]
}